﻿<script src="~/Scripts/WebsiteControllers/AlbumController.js"></script>
<div class="row" ng-controller="AlbumController">
    <div class="search-bar collapsed">
        <div class="form-group">
            <div class="input-group input-group-lg">
                <input type="text" class="form-control" placeholder="Type to search..." ng-model="search" ng-change="filter()">
                <span class="input-group-btn">
                    <button class="btn btn-square btn-lg btn-default no-shadow close-search-bar" type="button"><i class="zmdi zmdi-close"></i></button>
                </span>
            </div>
        </div>
    </div>
    <div class="col-md-12">
        <div class="bg-white bs-0 mb-20 widget">
            <ul class="nav nav-pills bg-black bs-inset-primary" role="tablist">
                <li role="presentation" class="pt-15 pb-15 pl-10 pr-20 mb-0">
                    <h3 class="fs-16 lh-1 m-0 text-white text-uppercase">Album</h3>
                </li>
                <li class="pull-right pt-15 pb-15 pl-20 pr-10 fs-20 lh-1 mb-0">
                    <ul class="pull-right list-inline fs-16 lh-1 mb-0">
                        <li><a href="javascript:;" class="text-white" ng-click="toggle('add','')"><i class="fa fa-plus-circle"></i></a></li>
                    </ul>
                </li>
            </ul>
            <div class="widget-body">
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-striped table-bordered">
                            <thead>
                                <th>Album Name<a ng-click="sort_by('AlbumName');"><i class="glyphicon glyphicon-sort"></i></a></th>
                                <th>Album By<a ng-click="sort_by('AlbumBy');"><i class="glyphicon glyphicon-sort"></i></a></th>
                                <th>Album Image<a ng-click="sort_by('AlbumBy');"><i class="glyphicon glyphicon-sort"></i></a></th>
                                <th>Action&nbsp;</th>
                            </thead>
                            <tbody>
                                <tr ng-repeat="data in list">
                                    <td>{{data.AlbumName}}</td>
                                    <td>{{data.AlbumBy}}</td>
                                    <td><a ng-if="data.AlbumtitleImage!=''" href="../../uploads/Album/AlbumTitleImage/{{data.AlbumtitleImage}}" target="_blank">View Image</a></td>
                                    <td>
                                        <div class="btn-group-sm" role="group" aria-label="Second group">
                                            <button type="button" class="btn btn-info waves-effect" ng-click="toggle('edit',data.AlbumId);"><i class="fa fa-pencil"></i></button>
                                            <button type="button" class="btn btn-danger waves-effect" ng-click="delete(data.AlbumName,data.AlbumId)"><i class="fa fa-trash"></i></button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-12" ng-show="filteredItems == 0">
                        <div class="col-md-12" style="text-align: center;">
                            <h4>No Data</h4>
                        </div>
                    </div>
                </div>
                <div ng-show="filteredItems > 0" style="padding-right: 10px; text-align: right;">
                    <div pagination="" page="currentPage" max-size="10" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="«" next-text="»"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade bs-example-modal-panel" tabindex="-1" id="Album" role="dialog" aria-labelledby="myPanelModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header bg-primary">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myAnimationModalLabel">{{title}}</h4>
                </div>
                <form name="fromvalidate" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <label>Album Name</label>
                            <input type="text" class="form-control" ng-model="Album.AlbumName" maxlength="100" ng-minlength="3" ng-required="true">
                        </div>
                        <div class="form-group">
                            <input type="hidden" value="Article.AlbumId" />
                            <label>Album Title</label>
                            <input type="text" class="form-control"  ng-model="Album.AlbumBy" maxlength="100" ng-minlength="3" ng-required="true">
                        </div>
                        <div class="form-group">
                            <label>Album Image</label>
                            <input type="file" name="fileInput" id="Input" onchange="angular.element(this).scope().FileAlbumImage(event)" class="upload" accept="image/*">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary" ng-disabled="fromvalidate.$invalid || buttonstate" ng-click="save(modelstate);">Save</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
